package com.slz3.business.module.configManagement.conActivityIndex.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conActivityIndex.domain.ConActivityIndex;
import com.slz3.business.module.configManagement.conActivityIndex.domain.ConActivityIndexCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class ConActivityIndexResController {

    static Mono<ServerResponse> add(ServerRequest req, ConActivityIndex conActivityIndex) {
        if (ConActivityIndexResUnsafeValid.add(req, conActivityIndex)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResAtomic.add_$ConActivityIndexUpdateLock(req, conActivityIndex);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, ConActivityIndexCondition conActivityIndexCondition) {
        if (ConActivityIndexResUnsafeValid.delete(req, conActivityIndexCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResAtomic.delete_$ConActivityIndexUpdateLock(req, conActivityIndexCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, ConActivityIndex conActivityIndex) {
        if (ConActivityIndexResUnsafeValid.modify(req, conActivityIndex)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResAtomic.modify_$ConActivityIndexUpdateLock(req, conActivityIndex);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (ConActivityIndexResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (ConActivityIndexResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResAtomic.info_$ConActivityIndexUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (ConActivityIndexResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, ConActivityIndexCondition conActivityIndexCondition) {
        //
        if (ConActivityIndexResUnsafeValid.auditSubmit(req, conActivityIndexCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResAtomic.auditSubmit_$ConActivityIndexUpdateLock(req, conActivityIndexCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, ConActivityIndexCondition conActivityIndexCondition) {
        if (ConActivityIndexResUnsafeValid.audit(req, conActivityIndexCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResAtomic.audit_$ConActivityIndexUpdateLock(req, conActivityIndexCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, ConActivityIndexCondition conActivityIndexCondition) {
        if (ConActivityIndexResUnsafeValid.auditReject(req, conActivityIndexCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResAtomic.auditReject_$ConActivityIndexUpdateLock(req, conActivityIndexCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, ConActivityIndexCondition conActivityIndexCondition) {
        if (ConActivityIndexResUnsafeValid.usingEnable(req, conActivityIndexCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResAtomic.usingEnable_$ConActivityIndexUpdateLock(req, conActivityIndexCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, ConActivityIndexCondition conActivityIndexCondition) {
        if (ConActivityIndexResUnsafeValid.usingDisable(req, conActivityIndexCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConActivityIndexResAtomic.usingDisable_$ConActivityIndexUpdateLock(req, conActivityIndexCondition);
        }
    }

}
